package com.cjm.one.common.rabbit.service;

import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

@Service
public class RabbitService {
    @Resource
    private RabbitTemplate rabbitTemplate;

    // 发送消息
    public Boolean sendMessage(String exchange,String routingkety, Object message) {
        rabbitTemplate.convertAndSend(exchange,routingkety, message);
        return true;
    }


}